<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>店铺商品展示</title>
<jsp:include page="header.jsp"></jsp:include>

</head>
<body>
 <div class="J-header"></div>
        <!-- 店铺主体内容 -->
       
		<div class="shop">
		 
			<div class="banner">
				<div class="ban-img">
			<c:forEach items="${page.data }" var="pd">
					<span class="shop-logo"><img src="${pd.spic }" alt="修正药业" /></span>
					<span class="shop-att"><a href="javascript:;">关注本店</a></span>
					<span class="shop-name">${pd.sname }自营旗舰店</span>
			</c:forEach>
				</div>
			</div>
			<div class="w1190">
				<div class="sp-nav">
					<ul>
						<li><a href="index">修正首页</a></li>
						<li class="all-drug"><a href="#">最新药品</a></li>
						<li><a href="#">最新药品</a></li>
						<li><a href="#">最新药品</a></li>
						<li><a href="shop-flow.jsp">加盟须知</a></li>
					</ul>
					<div class="sp-form">
						<input class="sp-form-itext" type="text" placeholder="请输入关键字" />
						<a href="javascript:;" class="sp-form-a">搜索</a>
					</div>
				</div>
				<div class="fl about">
				<c:forEach items="${page.data }" var="p">
					<h1>${p.sname }</h1>
					<!-- <div class="line"></div> -->
					<p>${p.summary }</p>
     				<p></p>
     				<a href="#"><img class="img" src="img/about_gg.jpg"/></a> 
     			</c:forEach>
				</div>
				<div class="fr drug">
					
					<!-- 推荐药品 -->
					<div class="d-item">
						<h2>推荐药品</h2>
						<ul>
							<li class="smal">
								<a class="tit" href="#">修正高钙蛋白粉450g/罐</a>
								<em><i>￥</i>288<i>.00</i></em>
								<img class="img" src="img/shop-drug1.jpg"/>
							</li>
							<li class="big">
								<a class="tit" href="#">全自动家用电子血压机上臂式血压测量仪</a>
								<em><i>￥</i>288<i>.00</i></em>
								<img class="img" src="img/shop-drug3.jpg"/>
							</li>
							<li class="smal last">
								<a class="tit" href="#">修正高钙蛋白粉450g/罐</a>
								<em><i>￥</i>288<i>.00</i></em>
								<img class="img" src="img/shop-drug2.jpg"/>
							</li>
							
						</ul>
						<div class="clearfix"></div>
					</div>
					<!-- 全部药品 -->
					<!-- 药品分页显示 -->
					<div class="d-item all-item">
						<h2>全部药品</h2>
						<ul>
							<c:choose>
								<c:when test="${empty page }">
									没有搜索到任何商品!
								</c:when> 
								<c:otherwise> 
									<c:forEach items="${page.data }" var="g"> 
										<li class="smal">
											<a class="tit" href="#">修正高钙蛋白粉450g/罐</a>
											<em><i>￥</i>${g.price }</em><br><br><br><br><br>
											<a href="/medicine/detailgoods?gid=${g.gid }"><img class="img" src="${g.fileName }"/></a>
										</li>
									</c:forEach>
								</c:otherwise>
							</c:choose>	
						</ul>
						<!-- 分页 -->
						 <div class="page">
							<ul>
							<c:if test="${page.pageIndex > 1}"> 
								<li><a class="no-page" href="ShowGoodsServlet?nextPage=${page.pageIndex-1 }">上一页</a></li>
							</c:if>
								<li><em>${page.pageIndex }</em></li>
								<li><a href="ShowGoodsServlet?nextPage=2">2</a></li>
								<li><a href="ShowGoodsServlet?nextPage=3">3</a></li> 
								<li>······</li>
								<c:if test="${page.pageIndex < page.totalPage }">
									<li><a href="ShowGoodsServlet?nextPage=${page.pageIndex+1 }">下一页</a></li>
								</c:if>
							</ul>
						</div>
						<div class="clearfix"></div>
					</div> 
					<!-- 药品分页显示结束 -->
					
				</div>
				<div class="clearfix"></div>
			</div>
			<div class="clearfix"></div>
		</div>
		<div class="clearfix"></div>
		<!-- footer -->	    
      <iframe src="footer.jsp" frameborder="0" width="100%" height="462" scrolling="no"></iframe>
      <script type="text/javascript">
      	$(function(){
      		
      		$('.all-drug').click(function(){
      			$('html,body').animate({scrollTop:$('.all-item').offset().top},1000);
      		});
      	});
      </script>

	</body>
</body>
</html>